package library.net.retrofit.callback;

import java.lang.reflect.Type;

import library.common.util.GsonUtils;
import okhttp3.ResponseBody;

/**
 * google Gson 转换 Bean
 *
 * @author Created by qiang.hou on 2017/12/18.
 * @version 1.0
 */
public abstract class RxGsonCallback<T> extends RxAbsCallback<T> {

    @SuppressWarnings("unchecked")
    @Override
    protected T transform(ResponseBody response, Type type) throws Exception {
        return (T) GsonUtils.fromJson(response.string(), type);
    }
}
